home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group94b.txt / 000103_icon-group-sender _Thu Nov 10 21:30:12 1994.msg < prev    next >
Internet Message Format  |  1995-02-09  |  2KB

  1. Received: by cheltenham.cs.arizona.edu; Fri, 11 Nov 1994 15:22:46 MST
  2. To: icon-group-l@cs.arizona.edu
  3. Date: 10 Nov 1994 21:30:12 -0700
  4. From: dave@cs.arizona.edu (Dave Schaumann)
  5. Message-Id: <39us0k$i35@caslon.CS.Arizona.EDU>
  6. Organization: University of Arizona CS Department, Tucson AZ
  7. Sender: icon-group-request@cs.arizona.edu
  8. References: <Cz2Ewr.Kr@beaver.cs.washington.edu>
  9. Subject: Re: Three Questions: Allocated, Memory, and C Functions/Porting to PC
  10. Errors-To: icon-group-errors@cs.arizona.edu
  11.  
  12. In article <Cz2Ewr.Kr@beaver.cs.washington.edu>,
  13. Gail Murphy <gmurphy@cs.washington.edu> wrote:
  14. >
  15. >1. Does anyone have any example programs using the &allocated keyword?
  16. >   From the documentation, I thought it would return 4 values, but
  17. >   I am only getting one on the DECstation and the Alpha using
  18. >   Icon 9.
  19.  
  20. Try this:
  21.  
  22.     procedure main()
  23.       every write( &allocated )
  24.     end
  25.  
  26. It works for me.
  27.  
  28. >2. I have an Icon program that must process input character by character for
  29. >   tokenizing. This creates a lot of garbage, slowing things down considerably.
  30.  
  31. Are you reading in characters one at a time?  If so, try reading in a
  32. line at a time.  I've done tokenizing (of Icon itself) that way.  I
  33. didn't check how bad garbage collection was, but the routine runs
  34. tolerably fast.
  35.  
  36. >3. [...] Can C functions be linked in with the PC version?
  37.  
  38. I don't know the immediate answer to this quetion.  I have looked at
  39. the documentation for combining C functions with Icon programs, and
  40. it looks like a lot of work (and probably over the head of the average
  41. Icon novice).  I would highly recommend looking hard for a solution within
  42. Icon before bailing to C.
  43.  
  44. -Dave
  45.